﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace BPM.Web.Shared.Data;

/// <summary>
/// 用户参数
/// </summary>
public partial class UserOutput : BaseVM
{
    [JsonPropertyName("id")]
    [Required]
    public long Id { get; set; }

    /// <summary>
    /// 账号
    /// </summary>
    [DisplayName("账号")]
    [JsonPropertyName("account")]
    [Required]
    public string? Account { get; set; }

    /// <summary>
    /// 昵称
    /// </summary>
    [DisplayName("昵称")]
    [JsonPropertyName("nickName")]
    public string? NickName { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    [DisplayName("姓名")]
    [JsonPropertyName("name")]
    [Required]
    public string? Name { get; set; }

    /// <summary>
    /// 头像
    /// </summary>
    [DisplayName("头像")]
    [JsonPropertyName("avatar")]
    public string? Avatar { get; set; }

    /// <summary>
    /// 生日
    /// </summary>
    [DisplayName("生日")]
    [JsonPropertyName("birthday")]
    [Required]
    public DateTimeOffset? Birthday { get; set; }

    /// <summary>
    /// 生日
    /// </summary>
    [DisplayName("生日")]
    [JsonIgnore]
    [Required]
    public DateTime? BirthdayEx
    {
        get => Birthday.HasValue ? Birthday.Value.DateTime : null;
        set => Birthday = value.HasValue ? DateTime.SpecifyKind(value.Value, DateTimeKind.Utc) : null;
    }

    /// <summary>
    /// 性别-男_1、女_2
    /// </summary>
    [DisplayName("性别")]
    [JsonPropertyName("sex")]
    [Required]
    public Sex Sex { get; set; }

    /// <summary>
    /// 邮箱
    /// </summary>
    [DisplayName("邮箱")]
    [JsonPropertyName("email")]
    [Required]
    public string? Email { get; set; }

    /// <summary>
    /// 手机
    /// </summary>
    [DisplayName("手机")]
    [JsonPropertyName("phone")]
    [Required]
    public string? Phone { get; set; }

    /// <summary>
    /// 电话
    /// </summary>
    [DisplayName("电话")]
    [JsonPropertyName("tel")]
    public string? Tel { get; set; }

    /// <summary>
    /// 状态-正常_0、停用_1、删除_2
    /// </summary>
    [DisplayName("状态")]
    [JsonPropertyName("status")]
    public CommonStatus Status { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [JsonPropertyName("sysEmpInfo")]
    public EmpOutput SysEmpInfo { get; set; } = new();

}
